//
//  EPubVC.m
//  Cunli
//
//  Created by lilubin on 15/7/9.
//  Copyright (c) 2015年 lilubin. All rights reserved.
//

#import "EPubVC.h"
#import "EPubController.h"

@interface EPubVC ()

@property (nonatomic, strong) EPubController *epubController;

@end

@implementation EPubVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createBackBtn];
    self.navigationItem.title = @"文章正文";
    self.epubController = [[EPubController alloc] init];
    CGRect frame = self.view.bounds;
    frame.size.height = frame.size.height-64;
    [self.epubController openBook:_epubPath atView:self.view withPageFrame:frame];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)createBackBtn
{
    UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame = CGRectMake(0, 0, 28, 28);
    [leftBtn setImage:[UIImage imageNamed:@"regback01"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    leftBtn.contentEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
    UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
    self.navigationItem.leftBarButtonItem = leftBarItem;
}

- (void)backAction
{
    [self.navigationController popViewControllerAnimated:YES];
}



@end
